/**
 * Created by IntelliJ IDEA.
 *
 * @Avatar: xyb
 * Date: 2017/9/5
 * Time: 21:48
 * To change this template use File | Settings | File Templates.
 */

package blog.web.index;

import blog.sys.service.FollowItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import pub.spring.web.mvc.ActionResult;

import java.util.List;

@Controller
public class MainController {

    @RequestMapping
    public ActionResult onInitIndex(Integer userId, Integer typeId) {
        ActionResult result = ActionResult.ok();
        List list = null;
        if (typeId == 0) {

        } else if (typeId == 1) {// 专题
            list = followItemService.onChoiceSpecialCont(userId, typeId);
        } else if (typeId == 2) {// 文集
            list = followItemService.onChoiceCorpusCont(userId, typeId);
        } else if (typeId == 3) {// 用户

        } else if (typeId == 4) {// 推送更新

        }
        result.setData(list);
        return result;
    }

    @Autowired
    private FollowItemService followItemService;

}
